<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus®">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <title>Document</title>
 </head>
 <body>
  
 </body>
 <script>
  var myDate = new Date();
   //获取年份
   var year = myDate.getFullYear();
   //获取月份
   var month = myDate.getMonth()+1;
   //获取当月的第几天
   var day = myDate.getDay();
   //获取当前的小时
   var hour = myDate.getHours();
   //获取当前的分钟
   var minute = myDate.getMinutes();
   //获取当前的秒数
   var second = myDate.getSeconds();

   console.log(year+"年"+month+"月"+day+"日"+hour+":"+minute+":"+second);
 </script>
</html>
